from rest_framework.generics import ListAPIView
from rest_framework.viewsets import ModelViewSet

from apps.goods.models import SpecificationOption, SPUSpecification
from apps.meiduo_admin.serializers.option import OptionModelSerializer, OptionSpecificationSerializer
from apps.meiduo_admin.utils import PageNum


class OptionAPIView(ModelViewSet):
    queryset = SpecificationOption.objects.all()
    serializer_class = OptionModelSerializer
    pagination_class = PageNum

class OptionSimple(ListAPIView):
    serializer_class = OptionSpecificationSerializer
    queryset = SPUSpecification.objects.all()